<?php
//连接数据库
$conn=new mysqli("localhost","root","123456","test");

if($conn->connect_error){
    die("连接失败");
}